import { defineStore } from 'pinia'
export const rightStore = defineStore('right', {
    state:()=>{
        return{
            rightlist:[],
            navs:[{
                title:"中控台",
                name:"/welcome",
                parent:"/"
            }],
            active:"/welcome",
            bread:['中控台']
        }
    },
    actions:{
        setright(arr){
            this.rightlist=arr
        },
        setActive(name){
            this.active=name
        },
        setnav(obj){
            this.navs.push(obj)
        },
        setBread(str){
            this.bread=[]
            let arr=str.split("-")
            console.log(arr)
            arr.forEach(item=>{
                    console.log(34)
                    this.bread.push(item)
                
            })
            console.log(this.bread)
        }
    },
    persist:{
        storage:window.sessionStorage
    } 
})